rm(list = ls())
options(warn=-1)
#------------------------------------------------------------------------------------------------------------
library(logr)
# Open log
lf <- log_open("02_load_matches.log")
setwd('~/Dropbox/Research/compliance_blocking/replication/GOTV')
#------------------------------------------------------------------------------------------------------------
load('Data/generated/gotv_cleaned.Rdata')
source('Code/helper_functions.R')
#------------------------------------------------------------------------------------------------------------
#Load libraries
#------------------------------------------------------------------------------------------------------------
library(AER)
library("quickblock")
library(estimatr)
library(tidyverse)
library(Matching)
#------------------------------------------------------------------------------------------------------------
log_print(sessionInfo())
#------------------------------------------------------------------------------------------------------------
#NOTE: to replicate the results exactly in the paper, Matching 4.9-11 must be used.
#Using a different version of the package will result in slightly different matches.
#The results will be similar to those reported in the paper, but not exact.
covariates = c("age", "turf", "voted99", "voted00", "missing99", "famsize", "primary",
    "missing_primary", "age18", "age35", "age50", "age65", "age2")

df_all = df

cities = unique(df_all$city)
#----------------------------------------------------------------------------------------
source("Code/run_matching.R")
#----------------------------------------------------------------------------------------
log_close()